/*
 * @Description: 
 * @Author: 邢
 * @Date: 2021-04-22 15:07:43
 * @LastEditTime: 2021-04-26 14:41:11
 * @LastEditors: 邢
 */
//知识笔记模块所有的request请求
import { request } from "umi"

//所有书籍请求
export const getAllBooks = ()=>request('/api/Knowledge',{method:"get"})

export const getBookItem = (id:string)=>request(`/api/Knowledge/${id}`)

export const getLikes = (id:string)=>{
    return request(`/api/Knowledge/${id}/views`,{method:'post'})}

export const setLikes = (id:string,type:string)=>{ 
    if(type){
        return request(`/api/Knowledge/${id}/likes`,{method:'post',data:{type}})
    }
    return request(`/api/Knowledge/${id}/likes`,{method:'post'})
}